package nextdate;

import java.util.Scanner;

/**
 * nextdate计算下一日.
 **/

public class NextDate {
  int year = 0;
  int month = 0;
  int day = 0;

  public NextDate() { }

  /**
   *NextDate问题.
   *
   * @param str 输入字符串
   * @return 返回下一日的字符串
   */
  public String nextDate(String str) {
    String[] strArr = str.split("/");
    year = Integer.parseInt(strArr[0]);
    month = Integer.parseInt(strArr[1]);
    day = Integer.parseInt(strArr[2]);
    String restr = "";
    if (day > 31 || day < 1 || month < 1 || month > 12 || year < 1900 || year > 2050) {
      restr = "输入错误";
    } else {
      if (month == 2) {
        if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {
          if (day == 28) {
            day++;
          }
          if (day == 29) {
            month++;
            day = 1;
          }
          if (day > 29) {
            restr = "输入错误";
          }
        } else {
          if (day == 28) {
            month++;
            day = 1;
          }
          if (day > 28) {
            restr = "输入错误";
          }
        }
      } else {
        if ((month == 4 || month == 6 || month == 9 || month == 11)) {
          if (day == 30) {
            month++;
            day = 1;
          } else if (day > 30) {
            restr = "输入错误";
          } else {
            day++;
          }
        } else if (day == 31 && (month == 1 || month == 3 || month == 5 || month == 7
                || month == 8 || month == 10 || month == 12)) {
          day = 1;
          if (month == 12) {
            year++;
            month = 1;
          } else {
            month++;
          }
        } else {
          day++;
        }
      }

    }
    if (restr != "输入错误") {
      restr = year + "/" + month + "/" + day;
    }
    return restr;
  }

  /**
   * 主程序.
   */
  @edu.umd.cs.findbugs.annotations.SuppressFBWarnings("DM_DEFAULT_ENCODING")
  public static void main(String []args) {
    NextDate nextDate = new NextDate();
    while (true) {
      Scanner scanner = new Scanner(System.in);
      String str = scanner.nextLine();
      System.out.println(nextDate.nextDate(str));
    }
  }
}
